import { Button } from "antd"
import React from "react"

const globalEvent = window.myEven
class A extends React.Component {
  statee = {
    infoToB: "哈哈哈，我来自A"
  }



  reportToB = () => {
    globalEvent.emit('someEvent', this.state.infoToB)
  }

  render() {
    return (
      <div>
        <Button onClick={this.reportToB}>点我把state传递给B</Button>

      </div>
    )
  }
}

export default A